﻿/* AgileFx Version 1.0
 * An open-source framework for rapid development of applications and services using Microsoft.net
 * Developed by: AgileHead
 * Website: www.agilefx.org
 * This component is licensed under the terms of the Apache 2.0 License.
 */

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AgileFx
{
    public interface II18nHandler
    {
        string GetString(string code);
    }

    public class I18n
    {
        public II18nHandler handler;

        public I18n()
        {
            handler = Config.GetI18nHandler();
        }

        public I18n(II18nHandler handler)
        {
            this.handler = handler;
        }
        
        public static string GetString(string code)
        {
            return new I18n().handler.GetString(code);
        }

        public static string GetString(string code, string[] parameters)
        {
            return string.Format(new I18n().handler.GetString(code), parameters);
        }
    }
}